package com.cxx.common.dto;

import com.cxx.common.PlainView;
import com.cxx.common.ReadView;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonView;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

@Getter
@Setter
@JsonView(PlainView.class)
public class AccountDto {
    @Schema(description = "id")
    @JsonView(ReadView.class)
    private Long id;

    @Schema(description = "账户名称")
    @NotBlank(message = "账户名称不能为空")
    private String accountName;

    @Schema(description = "密码")
    @NotBlank(message = "密码不能为空")
    private String password;

    @Schema(description = "用户名称")
    @NotBlank(message = "用户名称不能为空")
    private String username;

    @Schema(description = "账户状态")
    @JsonView(ReadView.class)
    private Integer state;

    @Schema(description = "创建日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @JsonView(ReadView.class)
    private Date date;
}
